<template>
  <div>
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>问题项目详情
          </p>
        </div>
        <div class="topright">
          <el-button type="info" @click="$router.go(-1)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe606;</span>返回
          </el-button>
        </div>
      </div>
    </div>
    <div class="main">
      <div class="nav">项目详情</div>

      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" class="tabs">
        <el-tab-pane label="项目信息" name="first">
          <!-- <div class="tables" v-if="ms_roleName != 'AreaManager' && ms_roleName != 'WorkTeamManager'">
            <table cellpadding="0" cellspacing="0" border="1">
              <tr>
                <td>工单委托日期</td>
                <td>{{baseInfo.entrustDate|dateFilter}}</td>
                <td>扩容类型</td>
                <td>{{baseInfo.bmkAddType}}</td>
              </tr>
              <tr>
                <td>所属单位</td>
                <td>{{baseInfo.bmkOrg}}</td>
                <td>所属工队</td>
                <td>{{baseInfo.bmkWorkteam}}</td>
              </tr>
              <tr>
                <td>修补扩类型</td>
                <td>{{baseInfo.bmkFixType}}</td>
                <td>所属项目部</td>
                <td>{{baseInfo.belongOrg}}</td>
              </tr>
              <tr>
                <td>片区</td>
                <td>{{baseInfo.bmkArea}}</td>
                <td>镇区</td>
                <td>{{baseInfo.bmkTown}}</td>
              </tr>
              <tr>
                <td>五级站点</td>
                <td>{{baseInfo.bmkStation}}</td>
                <td>需求内容</td>
                <td>{{baseInfo.bmkNeedContent}}</td>
              </tr>
              <tr>
                <td>关联安装工单号</td>
                <td>{{baseInfo.bmkRelevanceNo}}</td>
                <td>是否超时</td>
                <td>{{baseInfo.bmkIsovertime}}</td>
              </tr>
              <tr>
                <td>所属网格</td>
                <td>{{baseInfo.bmkGrid}}</td>
                <td>现场当前环节</td>
                <td>{{'无法扩容'}}</td>
              </tr>
              <tr>
                <td>要求完工日期</td>
                <td>{{baseInfo.planEdate|timeFilter}}</td>
                <td>备注</td>
                <td>{{baseInfo.errorDesc}}</td>
              </tr>
            </table>
          </div> -->
          <div class="tables">
            <table cellpadding="0" cellspacing="0" border="1">
              <tr>
                <td>工单委托日期</td>
                <td>{{baseInfo.entrustDate|timeFilter}}</td>
                <td>所属单位</td>
                <td>{{baseInfo.bmkOrg}}</td>
              </tr>
              <tr>
                <td>片区</td>
                <td>{{baseInfo.bmkArea}}</td>
                <td>镇区</td>
                <td>{{baseInfo.bmkTown}}</td>
              </tr>
              <tr>
                <td>五级站点</td>
                <td>{{baseInfo.bmkStation}}</td>
                <td>需求内容</td>
                <td>{{baseInfo.bmkNeedContent}}</td>
              </tr>
              <tr>
                <td>工单号</td>
                <td>{{baseInfo.bmkRelevanceNo}}</td>
                <td>所属网格</td>
                <td>{{baseInfo.bmkGrid}}</td>
              </tr>
              <tr>
                <td>施工单位</td>
                <td>{{baseInfo.bmkWorkteam}}</td>
                <td>施工人员</td>
                <td>{{baseInfo.workerName}}</td>
              </tr>
              <tr>
                <td>联系电话</td>
                <td>{{baseInfo.workerPhone}}</td>
                <td>修补扩类型</td>
                <td>{{baseInfo.bmkFixType}}</td>
              </tr>
              <tr>
                <td>现场当前环节</td>
                <td>{{'无法扩容'}}</td>
                <td>备注</td>
                <td>{{baseInfo.errorDesc}}</td>
              </tr>
              <tr>
                <td>要求完工日期</td>
                <td>{{baseInfo.planEdate|timeFilter}}</td>
                <td>无法扩容现场反馈照片</td>
                <!-- <td><a :href="baseInfo.fileUrl" :download="baseInfo.fileName"></a></td> -->
                <td>
                  <a href="javaScript:;" @click="photoFlag = true" class="red">查看照片</a>
                </td>
              </tr>
            </table>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>

    <!-- 照片弹窗列表 -->
    <div class="component-model">
      <el-dialog
        title="照片列表"
        :visible.sync="photoFlag"
        width="1140px"
      >
        <div class="input-box">
          <div class="checkbox">
            <el-table
              ref="multipleTable"
              :data="photoList"
              tooltip-effect="dark"
              style="width:100%"
              border
            >
              <el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
              <el-table-column label="照片名称" align="center" width="300" prop="fileName"></el-table-column>
              <el-table-column label="点击预览" align="center" prop="">
                <template slot-scope="scope">
                  <a href="javaScript:;" @click="openPhoto(scope.row.fileUrl)" class="red">{{scope.row.fileName}}</a>
                </template>
              </el-table-column>
              <el-table-column label="点击下载" align="center" prop="">
                <template slot-scope="scope">
                  <a :href="dataImg_url + scope.row.fileUrl" :download="scope.row.fileName" class="red">{{scope.row.fileName}}</a>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="photoFlag = false">确定</el-button>
        </span>
      </el-dialog>
    </div>
    <!-- 预览照片 -->
    <div class="component-model">
      <el-dialog
        title="预览照片"
        :visible.sync="checkPhoto"
        width="1140px"
      >
        <div class="input-box">
          <div class="checkbox">
            <img :src="photoUrl" style="max-width:900px;margin:10px auto">
          </div>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button @click="checkPhoto = false">确定</el-button>
        </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ms_roleName:localStorage.getItem('roleName'),
      activeName: "first",
      //项目信息
      baseInfo: {},
      photoFlag:false,
      checkPhoto:false,
      photoList:[],
      photoUrl:"",
      dataImg_url:img_url
    };
  },
  created() {},
  mounted() {
    this.proInfoInit();
  },
  methods: {
    //tab切换
    handleClick(tab, event) {
      switch (this.activeName) {
        case "first":
          //this.proInfoInit();
          break;
      }
    },
    // 项目信息
    proInfoInit() {
      let that = this,
        suCb = res => {
          console.log("项目信息", res);
          that.baseInfo = res.data.data||[]
          that.photoList = res.data.data.photoFileList||[];
        },
        erCb = res => {
          console.log(res);
        },
        req = {
          url: "/api/web/proProject/getBmkProDetails",
          methods: "post",
          data: { 
            proId: that.$route.params.proId 
          },
          success: suCb,
          error: erCb
        };
      that.$https(req);
    },
    // 预览 打开弹窗
    openPhoto(url){
      this.checkPhoto = true;
      this.photoUrl = img_url + url;
    }
  },
};
</script>
<style scoped>
.main {
  width: 1100px;
  margin: 20px auto;
  box-sizing: border-box;
  border: 1px solid #e4e4e4;
  font-size: 14px;
}
.main .nav {
  height: 40px;
  line-height: 40px;
  padding-left: 20px;
  text-align: left;
  background: #f3f3f3;
  color: #666;
  border-bottom: 1px solid #e4e4e4;
  margin-bottom: 30px;
}
.step-container {
  margin-bottom: 60px;
}
.gcl {
  margin-bottom: 20px;
}
.tabs {
  width: 1060px;
  margin: 20px auto;
}
.budget {
  margin-top: 20px;
  width: 100%;
  overflow: hidden;
  background: #f8f8f8;
  height: 35px;
  line-height: 35px;
  font-size: 14px;
  border: 1px solid #e4e4e4;
  border-bottom: none;
  padding: 0 20px;
  box-sizing: border-box;
  font-size: 14px;
  color: #666;
}
.gcl .title {
  background: #f8f8f8;
  height: 35px;
  line-height: 35px;
  color: #666;
  padding: 0 20px;
  font-size: 14px;
  border: 1px solid #e4e4e4;
  border-bottom: none;
  text-align: left;
}
.budget .title {
  float: left;
}
.budget div:last-of-type {
  float: right;
}
.gcl .tabs {
  width: 1060px;
  margin: 20px;
  box-sizing: border-box;
}
.nav {
  background: #f8f8f8;
  height: 50px;
  font-size: 14px;
  line-height: 50px;
  border-bottom: 1px solid #e4e4e4;
  text-align: left;
  padding-left: 20px;
  font-size: 14px;
  color: #666;
}
.tables table {
  width: 660px;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.budgetTable table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.budgetTable table td {
  /* width: 500px; */
  height: 40px;
}
.tables table td {
  height: 44px;
}
.tables table td:nth-of-type(2n) {
  text-align: left;
  padding-left: 20px;
}
.tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 160px;
  background: #f9fafc;
}
.costManage {
  overflow: hidden;
  font-size: 14px;
}
.costManage .left,
.costManage .right {
  float: left;
}
.costManage .left {
  margin-right: 60px;
}
.costManage .cost {
  text-align: left;
  color: #949494;
  margin-bottom: 10px;
}
.costManage .left span,
.costManage .right span {
  display: inline-block;
  width: 100px;
  text-align: right;
  padding-right: 10px;
  height: 30px;
  color: #666;
  font-size: 12px;
}
.costManage .left span i,
.costManage .right span i {
  color: red;
  vertical-align: middle;
  font-style: normal;
  padding-right: 2px;
}
.costManage .left input,
.costManage .right input {
  height: 30px;
  padding-left: 5px;
  outline: none;
  border: 1px solid #e4e4e4;
  border-radius: 2px;
}

/* 下面是进度管理的样式 */
.step-container {
  margin: 20px auto;
}
.table-title p {
  font-family: "PingFangSC-Regular", "PingFang SC";
  font-weight: 400;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  font-size: 16px;
  color: #666;
  text-align: left;
  line-height: 40px;
}

.tables table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.tables table td {
  height: 44px;
}
.tables table td:nth-of-type(2n) {
  text-align: left;
  padding-left: 20px;
  width: 332px;
}
.pipe-progress .tables table td:nth-of-type(2n),
.line-progress .tables table td:nth-of-type(2n),
.equipment-progress .tables table td:nth-of-type(2n) {
  width: 332px;
}
.tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 160px;
  background: #f9fafc;
}

.component-paging .table-bottom,
.component-paging .table-bottom,
.component-paging .table-bottom {
  width: 100%;
  margin-bottom: 20px;
}

.pipe-progress .table,
.line-progress .table,
.equipment-progress .table {
  margin-top: 20px;
}

/* 材料管理 */
.material-manage .search-header {
  width: 1028px;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
}

.material-manage .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  border-bottom: 0;
}

.material-manage .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  font-size: 14px;
  line-height: 45px;
  font-weight: 700;
  text-align: left;
  margin: 0 0 0 30px;
}

.material-manage .right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  margin-right: 30px;
}

.material-manage .right button {
  padding: 0 15px;
  height: 30px;
  margin: 6px 5px;
  line-height: 30px;
  font-size: 14px;
  color: #666;
  background-color: #fff;
  border: 1px solid #ccc;
}

.material-manage .right button:hover {
  background-color: #f3f3f3;
}

/* 资料归档 */
.data-back-sign,
.owner-data,
.design-check-data,
.process-manage-data,
.project-finish-data,
.official-data,
.move-system-data {
  margin: 20px auto;
}
.table-title-left {
  color: #1abc9c;
  font-size: 16px;
  float: right;
}

.gray {
  color: #ccc;
}

/* 删除按钮 */
.red {
  color: #48c9b0;
  font-size: 12px;
}

.data-back-sign .tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 110px;
  background: #f9fafc;
}

.move-system-msg .tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 140px;
  background: #f9fafc;
}

.table-title > div:last-of-type {
  float: right;
  margin: -45px 20px 10px;
}
.table-title > div:last-of-type span {
  display: inline-block;
  margin-left: 20px;
  padding: 5px 20px;
  margin-top: 10px;
  cursor: pointer;
  border-radius: 4px;
}
.table-title > div:last-of-type span:first-of-type {
  border: 1px solid #e4e4e4;
  color: #666;
  background: #fff;
}
.table-title > div:last-of-type span:last-of-type {
  border: 1px solid #1abc9c;
  color: #fff;
  background: #1abc9c;
}

/* 工程量管理 按钮组 */
.btn_group {
  text-align: left;
  margin-bottom: 15px;
}

/* 工程量管理 底部 价格显示 */
.gcl_footer {
  text-align: right;
}

.gcl_footer .gcl_footer_top {
  margin-bottom: 10px;
  font-size: 18px;
}

.gcl_footer .gcl_footer_top span:nth-child(2n),
.gcl_footer .gcl_footer_bottom span:nth-child(2n) {
  color: #1abc9c;
}

.gcl_footer .gcl_footer_bottom {
  margin-bottom: 10px;
  font-size: 19px;
}

.budgetTable table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.budgetTable table td,
th {
  height: 40px;
}

th {
  background-color: #f9fafc;
}

</style>
